import request from '@/utils/request'

// 查询应收汇总列表
export function listYspay(query) {
  return request({
    url: '/supermarket/yspay/list',
    method: 'get',
    params: query
  })
}

export function listYspayFzd(query) {
  return request({
    url: '/supermarket/yspay/listFzd',
    method: 'get',
    params: query
  })
}
// 查询应收汇总详细
export function getYspay(yspayId) {
  return request({
    url: '/supermarket/yspay/' + yspayId,
    method: 'get'
  })
}

// 新增应收汇总
export function addYspay(data) {
  return request({
    url: '/supermarket/yspay',
    method: 'post',
    data: data
  })
}

// 修改应收汇总
export function updateYspay(data) {
  return request({
    url: '/supermarket/yspay',
    method: 'put',
    data: data
  })
}

// 删除应收汇总
export function delYspay(yspayId) {
  return request({
    url: '/supermarket/yspay/' + yspayId,
    method: 'delete'
  })
}
//审核收款单
export function auditXsPay(data) {
  return request({
    url: '/supermarket/yspay/audit',
    method: 'post',
    data: data
  })
}
//核销收款单
export function hxXsPay(data) {
  return request({
    url: '/supermarket/yspay/hxPay',
    method: 'post',
    data: data
  })
}

//反制单
export function updateFzd(data) {
  return request({
    url: '/supermarket/yspay/Fzd',
    method: 'post',
    data: data
  })
}
//反审核
export function updFsh(yspayId) {
  return request({
    url: '/supermarket/yspay/Fsh/' + yspayId,
    method: 'get',
  })
}
